package com.bussiness.system.model;

import com.bussiness.system.dto.MyDeptUserDto;

import java.util.Date;

public class MyDeptUserEntity {
    private Long id;

    private Long userId;

    private Long deptId;

    private String status;

    private Date gmtCreate;

    private Date gmtModified;

    public MyDeptUserEntity(Long id, Long userId, Long deptId, String status, Date gmtCreate, Date gmtModified) {
        this.id = id;
        this.userId = userId;
        this.deptId = deptId;
        this.status = status;
        this.gmtCreate = gmtCreate;
        this.gmtModified = gmtModified;
    }

    public MyDeptUserEntity() {
        super();
    }

    public MyDeptUserEntity(MyDeptUserDto myDeptUserDto){
        this.deptId = Long.parseLong(myDeptUserDto.getDeptId());
        this.userId = Long.parseLong(myDeptUserDto.getUserId());
        this.status = myDeptUserDto.getStatus();
    }

    public void update(MyDeptUserEntity myDeptUserEntity, MyDeptUserDto myDeptUserDto){
        myDeptUserEntity.setId(Long.parseLong(myDeptUserDto.getId()));
        myDeptUserEntity.setDeptId(Long.parseLong(myDeptUserDto.getDeptId()));
        myDeptUserEntity.setUserId(Long.parseLong(myDeptUserDto.getUserId()));
        myDeptUserEntity.setStatus(myDeptUserDto.getStatus());
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public Long getDeptId() {
        return deptId;
    }

    public void setDeptId(Long deptId) {
        this.deptId = deptId;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status == null ? null : status.trim();
    }

    public Date getGmtCreate() {
        return gmtCreate;
    }

    public void setGmtCreate(Date gmtCreate) {
        this.gmtCreate = gmtCreate;
    }

    public Date getGmtModified() {
        return gmtModified;
    }

    public void setGmtModified(Date gmtModified) {
        this.gmtModified = gmtModified;
    }
}